// import config from '@/config'

const modules = import.meta.glob('./modules/**/*.{js,ts}', { eager: true })
const routeModuleList = []

Object.keys(modules).forEach((key) => {
  const mod = modules[key].default || {}
  const modList = Array.isArray(mod) ? [...mod] : [mod]
  routeModuleList.push(...modList)
})

// 根路由
const rootRoute = {
  path: '/',
  name: 'Root',
  // redirect: config.homePath,
  component: () => import('@/views/home/index.vue'),
  meta: {
    title: '首页',
    hideMenu: true
  }
}

export const basicRoutes = [rootRoute, ...routeModuleList]
